import React from 'react';
import PropTypes from 'prop-types';
import { Switch, Route } from 'react-router-dom';
import { connect } from 'react-redux';

import CustomHome from './CustomHome';
import Auth from './Auth';
import PrivateRoute from '../components/PrivateRoute';

const propTypes = {
  logged: PropTypes.bool.isRequired
};
const contextTypes = {
  theme: PropTypes.object.isRequired,
  router: PropTypes.object.isRequired
};
function Layout({ logged }) {
  return (
    <Switch>
      <Route path="/auth" component={Auth} />
      <Route path="" component={CustomHome} />
    </Switch>
  );
}

Layout.propTypes = propTypes;
Layout.contextTypes = contextTypes;
const mapStateToProps = state => ({
  logged: state.logged
});
export default connect(mapStateToProps)(Layout);
